package com.chf.config;

import com.chf.Bean.UserInfoBean;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

//表明这个为config类
@Configurable
//说明要扫描的包的路径  扫描其他注解进行配置
@ComponentScan(basePackages = "com.chf")
//Aop 动态代理
@EnableAspectJAutoProxy
public class SpringConfig {
    //将JavaBean类绑定到spring容器
    @Bean
    public UserInfoBean getUserInfoBean(){
        UserInfoBean userInfoBean = new UserInfoBean();
        userInfoBean.setUserName("张三");
        return userInfoBean;
    }
}
